﻿namespace QuickMail.DataModels
{
    using System;
    using System.Data.SQLite;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;

    using NLog;

    static class StaticFields
    {
        //public static readonly BitmapImage NoneImage = new BitmapImage(new Uri("pack://application:,,,/Resources/message_outline-32.png", UriKind.Absolute));
        //public static readonly BitmapImage SendImage = new BitmapImage(new Uri("pack://application:,,,/Resources/up2-32.png", UriKind.Absolute));
        //public static readonly BitmapImage GetImage = new BitmapImage(new Uri("pack://application:,,,/Resources/down3-32.png", UriKind.Absolute));

        public static readonly BitmapImage NoneImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/message-32.png", UriKind.Absolute));
        public static readonly BitmapImage SendImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/forward-arrow-32.png", UriKind.Absolute));
        public static readonly BitmapImage ReceiveImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/child_new_post-arrow-32.png", UriKind.Absolute));

        public static readonly BitmapImage OkImage = new BitmapImage
    (new Uri("pack://application:,,,/Resources/checkmark-32.png", UriKind.Absolute));
        public static readonly BitmapImage ErrorImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/error-32.png", UriKind.Absolute));
        
        public static readonly BitmapImage SendWhiteImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/forward-32w.png", UriKind.Absolute));
        public static readonly BitmapImage ReceiveWhiteImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/child_new_post-32w.png", UriKind.Absolute));
        public static readonly BitmapImage ErrorWhiteImage = new BitmapImage
            (new Uri("pack://application:,,,/Resources/error-32w.png", UriKind.Absolute));

        private static readonly Color _normalColor = new Color { A = 255, R = 255, G = 255, B = 255 };
        private static readonly Color _errorColor = new Color { A = 255, R = 255, G = 192, B = 203 };
        private static readonly Color _turquoiseColor = new Color { A = 255, R = 65, G = 177, B = 225 };
        private static readonly Color _blueColor = new Color { A = 255, R = 8, G = 111, B = 158 };
        private static readonly Color _greenColor = new Color { A = 255, R = 0, G = 128, B = 0 };

        private static readonly Color _normalTextColor = new Color { A = 255, R = 0, G = 0, B = 0 };
        private static readonly Color _successTextColor = new Color { A = 255, R = 0, G = 141, B = 181 };
        private static readonly Color _errorTextColor = new Color { A = 255, R = 178, G = 0, B = 0 };

        public static readonly SolidColorBrush NormalColorBrush = new SolidColorBrush(_normalColor);
        public static readonly SolidColorBrush ErrorColorBrush = new SolidColorBrush(_errorColor);
        public static readonly SolidColorBrush TurquoiseColorBrush = new SolidColorBrush(_turquoiseColor);
        public static readonly SolidColorBrush BlueColorBrush = new SolidColorBrush(_blueColor);
        public static readonly SolidColorBrush GreenColorBrush = new SolidColorBrush(_greenColor);

        public static readonly SolidColorBrush NormalTextColorBrush = new SolidColorBrush(_normalTextColor);
        public static readonly SolidColorBrush SuccessTextColorBrush = new SolidColorBrush(_successTextColor);
        public static readonly SolidColorBrush ErrorTextColorBrush = new SolidColorBrush(_errorTextColor);

        private static readonly string _dbPath = AppDomain.CurrentDomain.BaseDirectory + @"Resources\qm.sqlite";
        public static readonly SQLiteConnection DbConnection = new SQLiteConnection(String.Format("Data Source={0};", _dbPath));
        public static readonly string ResourcesPath = AppDomain.CurrentDomain.BaseDirectory + "Resources\\";
        public static readonly Logger Logger = LogManager.GetCurrentClassLogger();
        public static LanguageXml Lang;

        static StaticFields()
        {
            DbConnection.Open();
        }
    }
}
